import Vue from 'vue'
import Vuex from 'vuex';

Vue.use(Vuex);
const state = {
    count:1,
};
const getters = {
    newCount(){
        return state.count;
    },
    
};
const mutations = {
    add(state,payload){
        state.count += payload;
    }
};
const actions = {
    addAction(context,patload){
        context.commit('add',patload);
    }
}
// Vue.Store首字母大写
const store = new Vuex.Store({
    state:state,
    getters:getters,
    mutations:mutations,
    actions:actions
});

export default store;